package Operation;
import Book.Book;
import Book.BookList;

import java.util.Scanner;

public class Findoperation implements Interface{

    @Override
    public void work(BookList bookList) {
        System.out.println("输入你要查找的图书的书名：");
        Scanner scanner=new Scanner(System.in);
        String book=scanner.nextLine();
        int Quantity=bookList.getQuantity();
        for (int i = 0; i < Quantity; i++) {
            Book book1 = bookList.getpoi (i);
            if (book.equals(book1.getName())) {
                System.out.println("找到了这本书");
                System.out.println(book1);
                return;
                }
            System.out.println("没有找到");
        }
    }
}
